/*! \file
 * \brief Enter a brief description here.
 *
 * Enter a detailed description here. (optional)
 * \author Author (Ivo Wingelaar)
 * \date Date (2011)
 * \version Version (0.0.1)
 * \copyright Copyright (GNU LGPL v3)
 */

#ifndef __LYNX_LOG_MANAGER_HPP_INCLUDED__
#define __LYNX_LOG_MANAGER_HPP_INCLUDED__

#include "LynxConfig.hpp"

namespace Lynx
{

/** enumeration      **/
/** LYNX_E_LOG_LEVEL **/
//! A enumeration of all the the different loglevels.
enum LYNX_E_LOG_LEVEL
{
    ELL_INFORMATION,
    ELL_WARNING,
    ELL_ERROR,
    ELL_NONE,
    ELL_COUNT
};

/** class     **/
/** LogOutput **/
//! An interface that provides access to an object that prints text somewhere.
class LogOutput : public Myth::ReferenceCounter
{
public:
    /** virtual function **/
    /** print            **/
    //! Prints text somewhere, depends on implementation.
    /// \return void
    /// \param    const char *text
    ///         The text you want to print/display somewhere.
    virtual void print(const char* text) = 0;
};

/** class      **/
/** LogManager **/
//! An class providing logging functions.
class LogManager : public virtual Myth::ReferenceCounter
{
public:
    /** const virtual function **/
    /** get_log_level          **/
    //! Returns the logging level.
    /// \return LYNX_E_LOG_LEVEL
    ///         The logging level.
    /// \param  void
    virtual LYNX_E_LOG_LEVEL get_log_level(void) const = 0;

    /** virtual function **/
    /** set_log_level    **/
    //! Sets the logging level.
    /// \return void
    /// \param    LYNX_E_LOG_LEVEL level
    ///         The new level you want to set.
    virtual void set_log_level(LYNX_E_LOG_LEVEL level) = 0;

    /** virtual function **/
    /** log              **/
    //! Logs something.
    /// \return void
    /// \param    const char* text
    ///         The text you want to log.
    /// \param    LYNX_E_LOG_LEVEL level
    ///         The level of the message.
    virtual void log(const char* text,
                     LYNX_E_LOG_LEVEL level = ELL_INFORMATION) = 0;

    /** virtual function **/
    /** log              **/
    //! Logs something.
    /// \return void
    /// \param    const char* text
    ///         The text you want to log.
    /// \param    const char* hint
    ///         The hint you want to append to the text.
    /// \param    LYNX_E_LOG_LEVEL level
    ///         The level of the message.
    virtual void log(const char* text,
                     const char* hint,
                     LYNX_E_LOG_LEVEL level = ELL_INFORMATION) = 0;

    /** virtual function **/
    /** log              **/
    //! Logs something.
    /// \return void
    /// \param    const wchar_t* text
    ///         The text you want to log.
    /// \param    LYNX_E_LOG_LEVEL level
    ///         The level of the message.
    virtual void log(const wchar_t* text,
                     LYNX_E_LOG_LEVEL level = ELL_INFORMATION) = 0;

    /** virtual function **/
    /** log              **/
    //! Logs something.
    /// \return void
    /// \param    const wchar_t* text
    ///         The text you want to log.
    /// \param    const wchar_t* hint
    ///         The hint you want to append to the text.
    /// \param    LYNX_E_LOG_LEVEL level
    ///         The level of the message.
    virtual void log(const wchar_t* text,
                     const wchar_t* hint,
                     LYNX_E_LOG_LEVEL level = ELL_INFORMATION) = 0;

    /** const virtual function **/
    /** get_output_count       **/
    //! Returns the total amount of outputs.
    /// \return uint32_t
    ///         The total amount of outputs.
    /// \param  void
    virtual uint32_t get_output_count(void) const = 0;

    /** virtual function **/
    /** remove_output    **/
    //! Removes an output.
    /// \return void
    /// \param    uint32_t index
    ///         The index of the output to remove.
    virtual void remove_output(uint32_t index) = 0;

    /** virtual function **/
    /** add_output      **/
    //! Adds an output.
    /// \return void
    /// \param    LogOutput* output
    ///         A pointer to a logoutput to add.
    virtual void add_output(LogOutput* output) = 0;
};

} // namespace Lynx

#endif // __LYNX_LOG_MANAGER_HPP_INCLUDED__

